import request from "@/utils/request"

//定义公共的API
const BASE_URL = "/system/itrService";

export default {
    //用户分页查询
    getservicePageInfo(page, limit, searchObj) {
        return request({
            url: `${BASE_URL}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },

    // 添加或者修改
    saveOrUpdate() {
        if (this.itripUser.id != null) {
            this.updateservice();
        } else {
            this.addservice();
        }
    },

    // 添加套餐
    saveService(ITripService) {
        return request({
            url: `${BASE_URL}/addService`,
            method: 'post',
            data: ITripService
        })
    },

    // 根据id去得到一个套餐 
    getserviceById(id) {
        return request({
            url: `${BASE_URL}/findNodeById/${id}`,
            method: 'get'
        })
    },

    // 修改
    updateservice(service) {
        return request({
            url: `${BASE_URL}/updateITripService`,
            method: 'post',
            data: service
        })
    },
    //删除
    // 根据id去删除一个删除
    removeId(id) {
        return request({
            url: `${BASE_URL}/removeITripService/${id}`,
            method: 'delete'
        })
    },
    // //状态修改
    // updateStatus(id,activated){
    //     return request({
    //         url:`${BASE_URL}/updateStatus/${id}/${activated}`,
    //         method: 'get'
    //       }) 
    //  },
}